using System;

namespace GearOptimizer.DataObjects
{
    public class CharacterItems
    {
        public CharacterItems()
        {
            Head = new Item();
            Neck = new Item();

        }
        public int AverageItemLevel { get; set; }
        public int AverageItemLevelEquipped { get; set; }

        public Item Head { get; set; }
        public Item Neck { get; set; }
        public Item Shoulder { get; set; }
        public Item Back { get; set; }
        public Item Chest { get; set; }
        public Item Shirt { get; set; }
        public Item Wrist { get; set; }
        public Item Hands { get; set; }
        public Item Waist { get; set; }
        public Item Legs { get; set; }
        public Item Feet { get; set; }
        public Item Finger1 { get; set; }
        public Item Finger2 { get; set; }
        public Item Trinket2 { get; set; }
        public Item Trinket1 { get; set; }
        public Item MainHand { get; set; }
        public Item OffHand { get; set; }

        public void AddItemToSlot(Item item, SlotNames slotName)
        {
            switch (slotName)
            {
                case SlotNames.Head:
                    Head = item;
                    break;
                case SlotNames.Neck:
                    Neck = item;
                    break;
                case SlotNames.Shoulder:
                    Shoulder = item;
                    break;
                case SlotNames.Back:
                    Back = item;
                    break;
                case SlotNames.Chest:
                    Chest = item;
                    break;
                case SlotNames.Shirt:
                    Shirt = item;
                    break;
                case SlotNames.Wrist:
                    Wrist = item;
                    break;
                case SlotNames.Hands:
                    Hands = item;
                    break;
                case SlotNames.Waist:
                    Waist = item;
                    break;
                case SlotNames.Legs:
                    Legs = item;
                    break;
                case SlotNames.Feet:
                    Feet = item;
                    break;
                case SlotNames.Finger1:
                    Finger1 = item;
                    break;
                case SlotNames.Finger2:
                    Finger2 = item;
                    break;
                case SlotNames.Trinket2:
                    Trinket2 = item;
                    break;
                case SlotNames.Trinket1:
                    Trinket1 = item;
                    break;
                case SlotNames.MainHand:
                    MainHand = item;
                    break;
                case SlotNames.OffHand:
                    OffHand = item;
                    break;
                default:
                    throw new ArgumentOutOfRangeException("slotName");
            }
        }
    }

    public enum SlotNames
    {
        Head = 1,
        Neck,
        Shoulder,
        Back,
        Chest,
        Shirt,
        Wrist,
        Hands,
        Waist,
        Legs,
        Feet,
        Finger1, 
        Finger2, 
        Trinket2,
        Trinket1,
        MainHand,
        OffHand,
    }
}